﻿/*3.Write a program that safely compares floating-point
numbers with precision of 0.000001. Examples:
(5.3 ; 6.01) -> false; (5.00000001 ; 5.00000003) -> true 
 */

using System;

namespace Compare_floating_point_numbers
{
    class FloatComparison
    {
        static void Main()
        {
            float precision = 0.000001F;

            float one, two;
            one = 5.3f;
            two = 6.01f;
            bool compareResult = one + precision == two + precision;
            Console.WriteLine(compareResult);
            
            one = 5.00000001f;
            two = 5.00000003f;
            compareResult = one + precision == two + precision;
            Console.WriteLine(compareResult);
        }
    }
}
